<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

# 登录路由
Route::prefix('login')->group(function () {
    Route::post('/loginIn', [\App\Http\Controllers\Login::class, 'loginIn']);
    Route::post('/register', [\App\Http\Controllers\Login::class, 'register']);
    Route::post('/getUserAuth', [\App\Http\Controllers\Login::class, 'getUserAuth']);
});

# redis路由
Route::prefix('redis')->group(function () {
    Route::post('/getFirstUserInfoByName', [\App\Http\Controllers\Redis::class, 'getFirstUserInfoByName']);
    Route::post('/distributedLock', [\App\Http\Controllers\Redis::class, 'distributedLock']);
    Route::post('/distributedLockAndRabbitMQ', [\App\Http\Controllers\Redis::class, 'distributedLockAndRabbitMQ']);
});

# 工具类路由
Route::prefix('utils')->group(function () {
    Route::post('/getSysDate', [\App\Http\Controllers\Utils::class, 'getSysDate']);
});

# 记账小程序有关路由
Route::prefix('accounting')->group(function () {
    Route::post('/getAuthInfoByIds', [\App\Http\Controllers\Accounting::class, 'getAuthInfoByIds']);
    Route::post('/getBudgetByYearMonth', [\App\Http\Controllers\Accounting::class, 'getBudgetByYearMonth']);
    Route::post('/alterBudgetByMonthYear', [\App\Http\Controllers\Accounting::class, 'alterBudgetByMonthYear']);
    Route::post('/getExpensesType', [\App\Http\Controllers\Accounting::class, 'getExpensesType']);
    Route::post('/addExpenses', [\App\Http\Controllers\Accounting::class, 'addExpenses']);
    Route::post('/delExpenses', [\App\Http\Controllers\Accounting::class, 'delExpenses']);
    Route::post('/getHaveExpenseMonth', [\App\Http\Controllers\Accounting::class, 'getHaveExpenseMonth']);
    Route::post('/getHistoryInfoByYearMonth', [\App\Http\Controllers\Accounting::class, 'getHistoryInfoByYearMonth']);
    Route::post('/getHaveExpenseYear', [\App\Http\Controllers\Accounting::class, 'getHaveExpenseYear']);
    Route::post('/getMonthExpensesByYear', [\App\Http\Controllers\Accounting::class, 'getMonthExpensesByYear']);
    Route::post('/getMonthExpensesDetail', [\App\Http\Controllers\Accounting::class, 'getMonthExpensesDetail']);
});

# 测试路由
Route::prefix('test')->group(function () {
    Route::get('/testTTS', [\App\Http\Controllers\Test::class, 'testTTS']);
    Route::get('/test', [\App\Http\Controllers\Test::class, 'test']);
});

